package com.lzp.model;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.Type;
import org.joda.money.Money;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;

/**
 * @description: 数据库实体类定义--咖啡
 * @author: lzp
 * @createTime: 2021-11-24 07:32
 **/
@Entity
@Table(name = "T_COFFEE") // 映射表名
@Builder // builder模式
@Data // getter/setter/tostring
@NoArgsConstructor // 两个构造器
@AllArgsConstructor
public class Coffee extends BaseEntity {

    private String name;

    @Column
    @Type(type = "org.jadira.usertype.moneyandcurrency.joda.PersistentMoneyAmount",
            parameters = {@org.hibernate.annotations.Parameter(name = "currencyCode", value = "CNY")})
    private Money price;


}
